package com.yfqy.app.enums;

import lombok.Getter;

/**
 * 订单取消方式
 */
@Getter
public enum CancelType {
    USER_CANCEL((byte) 1),
    MANAGER_CANCEL((byte) 2),
    SYSTEM_CANCEL((byte) 3),
    ;

    CancelType(byte type) {
        this.type = type;
    }

    private final byte type;

    public static CancelType of(byte type) {
        for (CancelType cancelType : values()) {
            if (cancelType.type == type) {
                return cancelType;
            }
        }
        return null;
    }
}
